package com.newlink.building.main.mvp.contract

import android.content.Context
import com.newlink.building.common_base.base.IModel
import com.newlink.building.common_base.base.IPresenter
import com.newlink.building.common_base.base.IView
import com.newlink.building.common_base.model.bean.*
import io.reactivex.Observable

/**
 * Created by xiaodong on 2022/7/25.
 */
interface Module_Main_MainContract {

    interface View : IView {
        fun showLogoutSuccess(success: Boolean, reason: Int)
        fun showUserInfo(userInfo: UserInfoData)
        fun tokenAvailable()
    }

    interface Presenter : IPresenter<View> {
        fun logout(token: String, reason: Int)
        fun getUserInfo(token: String, userId: Long)
        fun checkTokenAvailable(token: String)
        fun connectMqttServer(context: Context, mqttObj: Base_MqttConnectWrapper)
    }

    interface Model : IModel {
        fun logout(token: String): Observable<HttpResult<Boolean>>
        fun getUserInfo(token: String, userId: Long): Observable<HttpResult<UserInfoData>>
        fun checkTokenAvailable(token: String): Observable<Base_BaseBean>
    }
}
